home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / Pascal / Snippets / PNL Libraries / Libraries / SpriteWorld / SpriteWorld files / Headers / SWCommonHeaders.h < prev    next >
Text File  |  1996-11-04  |  3KB  |  114 lines

  1. ///--------------------------------------------------------------------------------------
  2. //    SWCommonHeaders.h
  3. //
  4. //    Portions are copyright: c 1991-94 Tony Myles, All rights reserved worldwide.
  5. //
  6. //    Description:    common macros, constants, and stuff, used throughout SpriteWorld
  7. ///--------------------------------------------------------------------------------------
  8.  
  9. #ifndef __RETRACE__
  10. #include <Retrace.h>
  11. #endif
  12.  
  13. #ifndef __SWCOMMON__
  14. #define __SWCOMMON__
  15.  
  16.  
  17.              
  18. #if PRAGMA_ALIGN_SUPPORTED
  19. #pragma options align=mac68k
  20. #endif
  21.  
  22. ///--------------------------------------------------------------------------------------
  23. //    VBL-related stuff
  24. ///--------------------------------------------------------------------------------------
  25.  
  26. typedef struct VBLTaskRec VBLTaskRec;
  27. typedef VBLTaskRec *VBLTaskRecPtr, **VBLTaskRecHdl;
  28.  
  29. struct VBLTaskRec
  30. {
  31.     VBLTask    myVBLTask;
  32.     volatile Boolean hasVBLFired;
  33. };
  34.  
  35.  
  36. ///--------------------------------------------------------------------------------------
  37. //    sprite world definitions
  38. ///--------------------------------------------------------------------------------------
  39.  
  40. typedef struct SpriteWorldRec SpriteWorldRec;
  41. typedef SpriteWorldRec *SpriteWorldPtr, **SpriteWorldHdl;
  42.  
  43.  
  44. ///--------------------------------------------------------------------------------------
  45. //    sprite world macros
  46. ///--------------------------------------------------------------------------------------
  47.  
  48. #if defined(powerc) || defined(__powerc)
  49. #define SW_PPC 1
  50. #else 
  51. #define SW_PPC 0
  52. #endif
  53.  
  54. #if SW_PPC
  55. #define XSW_USE_C 1
  56. #else
  57. #define XSW_USE_C SW_USE_C
  58. #endif
  59.  
  60. #define SW_MIN(a, b) ((a) < (b) ? (a) : (b))
  61. #define SW_MAX(a, b) ((a) > (b) ? (a) : (b))
  62.  
  63.     // change this to '#define SW_FUNC pascal'
  64.     // to build a SpriteWorld library callable from pascal
  65. #define SW_FUNC pascal
  66.  
  67. // SWAssert - PNL
  68. #define SW_DEBUG 1
  69. #if SW_DEBUG
  70. #define SWAssert(x) SWAssertCode(x)
  71. #else
  72. #define SWAssert(x)
  73. #endif
  74. extern SW_FUNC void SWAssert( Boolean must );
  75.  
  76. #define kBitsPerByte 8
  77.  
  78. #if __MWERKS__
  79.  
  80. #define SW_ASM_FUNC asm
  81. #define SW_ASM_BEGIN machine 68020
  82. #define SW_ASM_END rts
  83.  
  84. #elif THINK_C
  85.  
  86. #define SW_ASM_FUNC
  87. #define SW_ASM_BEGIN asm 68020{
  88. #define SW_ASM_END }
  89.  
  90. #endif
  91.  
  92.  
  93. ///--------------------------------------------------------------------------------------
  94. //    compiled sprite definitions
  95. ///--------------------------------------------------------------------------------------
  96.  
  97. typedef short PixelCode, *PixelCodePtr, **PixelCodeHdl;
  98.  
  99. typedef void (*BlitFuncPtr)(
  100.     long srcStride,
  101.     long destStride,
  102.     Ptr srcBaseAddr,
  103.     Ptr destBaseAddr);
  104.  
  105. #if PRAGMA_ALIGN_SUPPORTED
  106. #pragma options align=reset
  107. #endif
  108.  
  109. #endif /*__SWCOMMON__*/
  110.  
  111.  
  112.  
  113.  
  114.